package cn.explink.dop.enums;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @ClassName: DeliveryCompanyEnum
 * @Description: 配送公司状态枚举
 * @author 孟凡岭
 * @date 2015年5月25日 下午5:25:51
 * @since AR1.0
 */
public enum DeliveryCompanyEnum {
	Enable(1, "启用"), Unable(2, "停用"), DELETE(3, "删除");

	private int value;
	private String text;

	private DeliveryCompanyEnum(int value, String text) {
		this.value = value;
		this.text = text;
	}

	public int getValue() {
		return this.value;
	}

	public String getText() {
		return this.text;
	}

	public static List<DeliveryCompanyEnum> getAllStatus() {
		List<DeliveryCompanyEnum> DeliveryCompanyEnum = new ArrayList<DeliveryCompanyEnum>();
		DeliveryCompanyEnum.add(Enable);
		DeliveryCompanyEnum.add(Unable);
		DeliveryCompanyEnum.add(DELETE);
		return DeliveryCompanyEnum;
	}

	public static String getTextByValue(int value) {
		List<DeliveryCompanyEnum> allStatus = DeliveryCompanyEnum.getAllStatus();
		for (DeliveryCompanyEnum status : allStatus) {
			if (status.getValue() == value) {
				return status.getText();
			}
		}
		return "";
	}
}
